const configWeb3 = require('../../config/web3');

const ethers = require('ethers');
let provider = new ethers.providers.JsonRpcProvider(configWeb3.provider);
let abi = configWeb3.abi.SmartToken;

module.exports = {
    async totalSupply(address) {
        let contract = new ethers.Contract(address, abi, provider);
        let res = await contract.totalSupply();
        return res.toString();
    },

    async owner(address) {
        let contract = new ethers.Contract(address, abi, provider);
        return await contract.owner();
    }
};